#ifndef RL_RS485_FSFX_H
#define RL_RS485_FSFX_H

#include <Arduino.h>
#include <SoftwareSerial.h>





class RS485_FSFX : public SoftwareSerial {
    public:

        RS485_FSFX(short rxPin, short txPin) :  SoftwareSerial(rxPin,txPin) { };
        void requestfs();
        float readfs();
        int readfs_level();
        void requestfx();
        float readfx();
        bool readfx_dir(int dir);

      
    private:

        byte fs_request[8] = {0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x84, 0x0A};//风速  0X01 对应指令
        byte fx_request[8] = {0x02, 0x03, 0x00, 0x00, 0x00, 0x02, 0xc4, 0x38};//风向  0X02 对应指令
        byte fs_buf[7];
        byte fx_buf[9];

};


#endif
